<template>
    <view>
        <image :src="captchaUrl" @click="refreshCaptcha" mode="widthFix"></image>
        <input v-model="captchaCode" placeholder="请输入验证码" />
    </view>
</template>

<script>
	import config from '../config';  //引入config来设置全局的东西
export default {
    data() {
        return {
            captchaUrl: '/captcha/image',
            captchaCode: ''
        };
    },
    methods: {
        refreshCaptcha() {
            this.captchaUrl = config.apiUrl+'/captcha/image?' + new Date().getTime();
        }
    }
};
</script>